package hot100;

import com.二叉树.练习题.TreeNode;

public class h3_翻转二叉树 {
    public TreeNode invertTree(TreeNode root) {
        fn(root);
        return root;
    }
    private void fn(TreeNode node){
        if(node == null){
            return;
        }
        TreeNode t = node.left;
        node.left = node.right;
        node.right = t;
        fn(node.left);
        fn(node.right);
    }
}
